x86/schedule: remove noreturn from schedule_tail() function pointer
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 10 Mar 2014 10:18:05 +0000 (11:18 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 10 Mar 2014 10:18:05 +0000 (11:18 +0100)
commit7fb8e8b4e58cdd0a4ac457fd25342b35b6851521
tree70f68a7a898f645937db53e476f3d6aca931778c
parentbf15e5b64e262b5e44244f4ea605de25d6af1ea6
x86/schedule: remove noreturn from schedule_tail() function pointer

XenServer has recently had a support case where this bugframe in
context_switch() was hit, presumably from a corrupt function pointer as the
vcpu pointer was fine.

On balance, it is better to leave the bugframe around for peace of mind in
exceptional circumstances, than to use the optimisations provided by noreturn.

At any meaningful levels of optimisation, the noreturn causes the bugframe to
be optimised out, meaning that any exceptional returns fall into unlikely
branches, which will result in very weird behaviour.

The unreachable() in BUG() does the useful part of noreturn for us, allowing
the compiler not to mess about restoring stack frames etc, but causes a ud2
instruction to be present.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/include/asm-x86/current.h
xen/include/asm-x86/domain.h